package com.example.anew.journey.mynewjourney.adpater;
import android.support.v7.widget.RecyclerView;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;
import android.widget.TextView;

import com.example.anew.journey.mynewjourney.R;
import com.example.anew.journey.mynewjourney.inteface.OnRecyclerViewItemClickListener;

import java.util.ArrayList;
import java.util.List;
/**
 * 杭州惟君医疗科技有限公司10
 * Created by 20433 on 2018/3/8
 */
public class EquipmentAdapter extends  RecyclerView.Adapter<EquipmentAdapter.ViewHolder> implements View.OnClickListener {
    private OnRecyclerViewItemClickListener mOnItemClickListener = null;
    private List<?> mlist = new ArrayList<>();
    public void setOnItemClickListener(OnRecyclerViewItemClickListener listener) {
        this.mOnItemClickListener = listener;
    }
    @Override
    public EquipmentAdapter.ViewHolder onCreateViewHolder(ViewGroup parent, int viewType) {
        View view = LayoutInflater.from(parent.getContext()).inflate(R.layout.item_equipment,parent,false);
        ViewHolder viewHolder = new ViewHolder(view);
        view.setOnClickListener(this);
        return viewHolder;
    }
    @Override
    public void onBindViewHolder(EquipmentAdapter.ViewHolder holder, int position) {}
    @Override
    public int getItemCount() {
        return 0;
    }
    @Override
    public void onClick(View view) {
        if(mOnItemClickListener != null ){
            mOnItemClickListener.onItemClick(view);
        }
    }
    /**
     * 身体布局Holder
     */
    static class ViewHolder extends RecyclerView.ViewHolder {
        private final ImageView iv_devices_picture;
        private final TextView tv_devices_name;
        private final TextView tv_isbanding;
        public ViewHolder(View itemView) {
            super(itemView);
            iv_devices_picture = (ImageView)itemView.findViewById(R.id.item_equipment_iv_devices_picture);
            tv_devices_name = (TextView)itemView.findViewById(R.id.item_equipment_tv_devices_name);
            tv_isbanding = (TextView)itemView.findViewById(R.id.item_equipment_tv_isbanding);
        }
    }
}
